package com.xiaohe66.web.domain.im.repository;

import com.xiaohe66.common.value.Paging;
import com.xiaohe66.web.domain.account.value.AccountId;
import com.xiaohe66.web.domain.im.agg.Message;
import com.xiaohe66.web.domain.im.value.MessageId;
import com.xiaohe66.web.domain.im.value.MessageUnread;
import com.xiaohe66.web.integration.domain.Repository;

import java.util.List;

/**
 * @author xiaohe
 * @since 2023-08-09 16:00
 */
public interface MessageRepository extends Repository<Message, MessageId> {

    List<MessageUnread> countByAccountIdUnread(AccountId accountId);

    List<Message> listByAccount(AccountId accountId, MessageId beforeId);
    
    List<Message> pageByAccountId(Paging paging, AccountId accountId);

    List<Message> pageOfAccountId(Paging paging, AccountId createId, AccountId accountId);

}
